<%@ Page Language="C#" MasterPageFile="~/MP/Classic.master" AutoEventWireup="true"
    Inherits="ConfigCusto_EditEntity" CodeBehind="EditEntity.aspx.cs" RoleHint="Administrator" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageContainer" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td colspan="4">
                        <h1>
                            Shared schema</h1>
                        <br />
                        <asp:GridView ID="SharedFieldsGrid" ToolTip="The shared schema is static" runat="server"
                            AutoGenerateColumns="False" Width="100%">
                            <Columns>
                                <asp:BoundField DataField="name" HeaderText="Field">
                                    <HeaderStyle Width="155px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="typeName" HeaderText="Type">
                                    <HeaderStyle Width="155px" />
                                </asp:BoundField>
                            </Columns>
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <br />
                        <br />
                        <h1>
                            Custom schema</h1>
                        <br />
                        <asp:GridView ID="CustomFieldsGrid" runat="server" AutoGenerateColumns="False" OnRowDeleting="CustomFieldsGrid_RowDeleting"
                            Width="100%">
                            <Columns>
                                <asp:BoundField DataField="name" HeaderText="Field">
                                    <HeaderStyle Width="155px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="typeName" HeaderText="Type">
                                    <HeaderStyle Width="155px" />
                                </asp:BoundField>
                                <asp:CheckBoxField DataField="isVisibleFromApplicationForm" HeaderText="Visible from Application"
                                    ReadOnly="true">
                                    <HeaderStyle Width="55px" />
                                </asp:CheckBoxField>
                                <asp:CommandField DeleteText="Remove" ShowDeleteButton="True" />
                            </Columns>
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:TextBox ID="NameTextBox" runat="server" Width="150px"></asp:TextBox>&nbsp;
                        <asp:RequiredFieldValidator ID="NameRequired" runat="server" ErrorMessage="Please enter a name for the field"
                            ControlToValidate="NameTextBox" class="errorShort">Please enter a name for the field</asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:DropDownList ID="FieldDropDown" runat="server" Width="150px" DataTextField="Value"
                            DataValueField="Key">
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:CheckBox ID="IsVisibleCheckBox" runat="server" Width="50px"></asp:CheckBox>
                    </td>
                    <td>
                        <asp:Button ID="AddButton" runat="server" Text="Add" OnClick="AddButton_Click" Width="50px" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="center">
                        <br />
                        <asp:Button ID="SaveButton" runat="server" Text="Save entity customizations " OnClick="SaveButton_Click"
                            CausesValidation="False" />
                    </td>
                </tr>
            </table>
            <asp:ValidationSummary ID="ValidationSummary" runat="server" />
            <div style="text-align: right">
                <asp:LinkButton ID="DemoLinkButton" runat="server" Text="[demo]" OnClick="DemoLinkButton_Click" /><br />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
